From: Jonathan Dieter Date: Wed, 6 Jun 2018 10:23:04 +0000 (+0300) Subject: Fix error where we don't check for hash_type < 0 X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~238 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=85f21322aebb793ee35bdb1ad16d00ac7d92fb49;p=zchunk.git Fix error where we don't check for hash_type < 0 Signed-off-by: Jonathan Dieter --- diff --git a/src/lib/hash/hash.c b/src/lib/hash/hash.c index 29f5560..de9277f 100644 --- a/src/lib/hash/hash.c +++ b/src/lib/hash/hash.c @@ -409,7 +409,7 @@ int PUBLIC zck_validate_data_checksum(zckCtx *zck) { } const char PUBLIC *zck_hash_name_from_type(int hash_type) { - if(hash_type > 1) { + if(hash_type > 1 || hash_type < 0) { snprintf(unknown+8, 21, "%i)", hash_type); return unknown; }